import { defHttp } from '@/utils/http/axios';

enum Api {
  PLAN = '/plan',
}
/**
 * @description: plan
 */
export function planPageApi(params) {
  return defHttp.get<any>({
    url: Api.PLAN,
    params,
    headers: {
      // @ts-ignore
      ignoreCancelToken: true,
    },
  });
}

export function planAddApi(params) {
  return defHttp.post<any>(
    {
      url: Api.PLAN,
      params,
    },
    {
      errorMessageMode: 'none',
    },
  );
}

export function planUpdateApi(params) {
  return defHttp.put<any>(
    {
      url: Api.PLAN,
      params,
    },
    {
      errorMessageMode: 'none',
    },
  );
}

export function planDeleteApi(params) {
  const { idList } = params;
  return defHttp.delete<any>(
    {
      url: `${Api.PLAN}?idList=${idList}`,
    },
    {
      errorMessageMode: 'none',
    },
  );
}
